QT       += core gui network serialport xml

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

LIBS += -lshlwapi
LIBS += -lpthread libwsock32 libws2_32 libwinmm
LIBS += -L$$PWD/../OpenSource/libusb/mingw64/dll -L$$PWD/../OpenSource/libusb/mingw/x64/bin -lusb-1.0
LIBS += -lsetupapi
LIBS += -lhid
LIBS += -L$$PWD/../platform/3XBurn/dll -lburn
LIBS += -L$$PWD/../OpenSource/openssl/build_mingw_64_dll -llibssl-3-x64 -llibcrypto-3-x64
LIBS += -liphlpapi -lssp
INCLUDEPATH += ../OpenSource/openssl/include
INCLUDEPATH += ../OpenSource/libusb/libusb
INCLUDEPATH += ../platform/3XBurn/include
RC_FILE += BurnToolPro.rc
#CONFIG += console
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

QMAKE_CXXFLAGS += -fPIC
unix {
    QMAKE_CXXFLAGS += -fstack-protector-all
}
QMAKE_CXXFLAGS += -fPIE -pie
QMAKE_CXXFLAGS += -Wl,-z,relro
QMAKE_CXXFLAGS += -z,now
QMAKE_CXXFLAGS += -Wl,-z,noexecstack
QMAKE_CXXFLAGS += -Wl,--nxcompat -Wl,--dynamicbase -Wl,--noseh -Wl,--no-seh
QMAKE_CXXFLAGS += -Wfloat-equal -Wl,-Bsymbolic -Wl,--no-undefined -Wl,--allow-multiple-definition
QMAKE_LFLAGS += "-Wl,--no-seh -Wl,--dynamicbase -Wl,--nxcompat"
QMAKE_LFLAGS += "-Wl,--allow-multiple-definition"

SOURCES += \
    ../platform/Securec/memset_s.c \
    BurnCtrl/BurnCtrl.cpp \
    BurnCtrl/BurnCtrl3X.cpp \
    BurnCtrl/BurnCtrlDfu.cpp \
    BurnCtrl/BurnCtrlFaction.cpp \
    BurnCtrl/BurnCtrlHsan.cpp \
    BurnCtrl/BurnCtrlJLink.cpp \
    BurnCtrl/BurnCtrlJlinkWorker.cpp \
    BurnCtrl/BurnCtrlSle.cpp \
    BurnCtrl/BurnCtrlMcu.cpp \
    BurnCtrl/BurnCtrlWorker.cpp \
    BurnCtrl/CmdCtrl.cpp \
    BurnCtrl/WifiBurnCtrl.cpp \
    BurnCtrl/readhex.cpp \
    BurnDlg/AboutWindow.cpp \
    BurnDlg/BinFileModel.cpp \
    BurnDlg/BurnDlg.cpp \
    BurnDlg/BurnDlg3X.cpp \
    BurnDlg/BurnDlgDfu.cpp \
    BurnDlg/BurnDlgFaction.cpp \
    BurnDlg/BurnDlgHsan.cpp \
    BurnDlg/BurnDlgJLink.cpp \
    BurnDlg/BurnDlgSle.cpp \
    BurnDlg/BurnDlgMcu.cpp \
    BurnDlg/ChangeChip.cpp \
    BurnDlg/ComboBoxCom.cpp \
    BurnDlg/EraseConfigSetting.cpp \
    BurnDlg/IPConfigSetting.cpp \
    BurnDlg/IpInputControl.cpp \
    BurnDlg/MultipleBurnDlg.cpp \
    BurnDlg/MultipleBurnDlgForOne.cpp \
    BurnDlg/MyComboBox.cpp \
    BurnDlg/ParamSettingDlg.cpp \
    BurnDlg/WifiBurnDlg.cpp \
    BurnToolCommon/AESUtils.cpp \
    BurnToolCommon/Global.cpp \
    BurnToolCommon/MyThread.cpp \
    BurnToolCommon/OperationLog.cpp \
    BurnToolCommon/ProductVersion.cpp \
    BurnToolCommon/StringClass.cpp \
    BurnToolCommon/UKeyUtils.cpp \
    BurnToolCommon/UsbPacket.cpp \
    CheckCom.cpp \
    DataConvertor.cpp \
    DiaglogComSetting.cpp \
    DiaglogJLinkSetting.cpp \
    DiaglogUSBSetting.cpp \
    Modem/YModem.cpp \
    RMDA_TIME_STRU.cpp \
    SecureLink/Channel.cpp \
    SerialPort/PortBase.cpp \
    SerialPort/PortManager.cpp \
    SerialPort/SerialPort.cpp \
    SerialPort/SerialPortWork.cpp \
    SerialPort/TcpPortWork.cpp \
    SerialPort/TcpPort.cpp \
    SerialPort/UsbPort.cpp \
    main.cpp \
    upgrade/UpgradeDlg.cpp \
    upgrade/LibMain.cpp \
    upgrade/util.cpp

HEADERS += \
    ../platform/3XBurn/include/Burn.h \
    ../platform/3XBurn/include/Common.h \
    ../platform/Securec/secinput.h \
    ../platform/Securec/securec.h \
    ../platform/Securec/securectype.h \
    ../platform/Securec/securecutil.h \
    ../platform/Securec/secureprintoutput.h \
    BurnCtrl/BurnCtrl.h \
    BurnCtrl/BurnCtrl3X.h \
    BurnCtrl/BurnCtrlDfu.h \
    BurnCtrl/BurnCtrlFaction.h \
    BurnCtrl/BurnCtrlHsan.h \
    BurnCtrl/BurnCtrlJLink.h \
    BurnCtrl/BurnCtrlJlinkWorker.h \
    BurnCtrl/BurnCtrlSle.h \
    BurnCtrl/BurnCtrlMcu.h \
    BurnCtrl/BurnCtrlWorker.h \
    BurnCtrl/CmdCtrl.h \
    BurnCtrl/WifiBurnCtrl.h \
    BurnCtrl/readhex.h \
    BurnDlg/AboutWindow.h \
    BurnDlg/BinFileModel.h \
    BurnDlg/BurnDlg.h \
    BurnDlg/BurnDlg3X.h \
    BurnDlg/BurnDlgDfu.h \
    BurnDlg/BurnDlgFaction.h \
    BurnDlg/BurnDlgHsan.h \
    BurnDlg/BurnDlgJLink.h \
    BurnDlg/BurnDlgSle.h \
    BurnDlg/BurnDlgMcu.h \
    BurnDlg/BurnToolVersion.h \
    BurnDlg/ChangeChip.h \
    BurnDlg/ComboBoxCom.h \
    BurnDlg/EraseConfigSetting.h \
    BurnDlg/IPConfigSetting.h \
    BurnDlg/IpInputControl.h \
    BurnDlg/MultipleBurnDlg.h \
    BurnDlg/MultipleBurnDlgForOne.h \
    BurnDlg/MyComboBox.h \
    BurnDlg/ParamSettingDlg.h \
    BurnDlg/WifiBurnDlg.h \
    BurnToolCommon/AESUtils.h \
    BurnToolCommon/CAdapter.h \
    BurnToolCommon/CompatibleCmd.h \
    BurnToolCommon/CompatibleMss.h \
    BurnToolCommon/Global.h \
    BurnToolCommon/MyThread.h \
    BurnToolCommon/OperationLog.h \
    BurnToolCommon/ProductVersion.h \
    BurnToolCommon/QCArray.h \
    BurnToolCommon/StdAfx.h \
    BurnToolCommon/StringClass.h \
    BurnToolCommon/TYPES.h \
    BurnToolCommon/UKeyUtils.h \
    BurnToolCommon/UsbPacket.h \
    BurnToolCommon/diagCmdId.h \
    BurnToolCommon/portable.h \
    BurnToolCommon/sop_errno.h \
    BurnToolCommon/usbDfu.h \
    CheckCom.h \
    DataConvertor.h \
    DiaglogComSetting.h \
    DiaglogJLinkSetting.h \
    DiaglogUSBSetting.h \
    Modem/YModem.h \
    RMDA_TIME_STRU.h \
    SecureLink/Channel.h \
    SerialPort/PortBase.h \
    SerialPort/PortManager.h \
    SerialPort/SerialPort.h \
    SerialPort/SerialPortWork.h \
    SerialPort/TcpPort.h \
    SerialPort/TcpPortWork.h \
    SerialPort/UsbPort.h \
    upgrade/UpgradeDlg.h \
    upgrade/LibMain.h \
    upgrade/util.h

RESOURCES += \
    images.qrc \
    translators.qrc

DISTFILES += \
    BurnTool.pro.user \
    BurnToolPro.rc

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

TRANSLATIONS += CNBurnTool.ts

FORMS += \
    BurnDlg/BurnDlg3X.ui \
    BurnDlg/BurnDlgDfu.ui \
    BurnDlg/BurnDlgHsan.ui \
    BurnDlg/BurnDlgJLink.ui \
    BurnDlg/BurnDlgSle.ui \
    BurnDlg/BurnDlgMcu.ui \
    BurnDlg/EraseConfigSetting.ui \
    BurnDlg/IPConfigSetting.ui \
    BurnDlg/MultipleBurn.ui \
    BurnDlg/MultipleBurnDlgForOne.ui \
    BurnDlg/ParamSettingDlg.ui \
    BurnDlg/WifiBurnDlg.ui \
    MenuSettingUSB.ui \
    MenuSettings.ui \
    MenuSettingsJLink.ui \
    upgrade/UpgradeDlg.ui
